<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="common/include :: header('服务项列表')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="post-form">
					<div class="select-list">
						<div class="form-group">
							<label class="col-sm-3 control-label is-required">仓库：</label>
							<div class="col-sm-8">
								<input class="form-control" disabled th:value="${stockBill.store.storeName}" type="text" name="name" id="postName" required>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label is-required">业务时间：</label>
							<div class="col-sm-8">
								<input class="form-control"  th:value="${#dates.format(stockBill.operateDate, 'yyyy-MM-dd')}" type="text">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">备注：</label>
							<div class="col-sm-8">
								<textarea id="info" th:text="${stockBill.remark}" name="info" class="form-control"></textarea>
							</div>
						</div>
					</div>
				</form>
			</div>

	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="common/include :: footer" />


	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('system:post:edit')}]];
		var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
		var stock_bill_id = [[${stockBill.id}]];
		var prefix = ctx + "/business/stockBillItem";
		$(function() {
		    var options = {
		        url: prefix + "/query?id="+stock_bill_id,
		        createUrl: prefix + "/addPage",
		        updateUrl: prefix + "/editPage?id={id}",
		        removeUrl: prefix + "/remove",
		        exportUrl: prefix + "/export",
		        modalName: "服务项",
		        columns: [
		        {
		            field: 'id',
		            title: '序号',
					visible: true,
                    formatter:function (value,row,index) {
                        //获取每页显示的数量
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回序号
                        return pageSize * (pageNumber - 1) + index + 1;
                    }
		        },
		        {
		            field: 'goods.goodsName',
		            title: '物品',
		            sortable: true
		        },

		        {
		            field: 'price',
		            title: '价格',
		            sortable: true
		        },
		        {
		            field: 'amounts',
		            title: '数量',
		            sortable: true
		        },
				{
					field: 'originalPrice',
					title: '小计',
					sortable: true,
					formatter: function(value, row, index) {
						return row.price *row.amounts;
					}
				}]
		    };
		    $.table.init(options);
		});

	</script>
</body>
</html>